import { lazy } from "react";
import { createBrowserRouter } from 'react-router-dom'
import {
    DesktopOutlined,
    FileOutlined,
    PieChartOutlined

} from '@ant-design/icons';
const Home = lazy(() => import('../page/Home/index'))
const Order = lazy(() => import('../page/Order/index'))
const Index = lazy(() => import('../page/Index/index'))
const App = lazy(() => import('../App'))
const Login=lazy(()=>import('../page/Login/index'))

export const Zi = [
    {
        path: '/home',
        element: <Home></Home>,
        title: '首页',
        icon: <DesktopOutlined />,
        children: [
            {
                path: '/home/order',
                element: <Order></Order>,
                title: '订单',
                icon: <FileOutlined />,

            }
        ]

    },
    {
        path: '/index',
        element: <Index></Index>,
        title: '页面管理',
        icon: <PieChartOutlined />,

    }
]


const routes = createBrowserRouter([
    {
        path: '/',
        element: <App></App>,
        children: Zi

    },
    {
        path: '/login',
        element: <Login></Login>,
       

    }
])
export default routes